# 要求完成下面矩阵的转置：
# 1 2 3 1      1 4 7
# 4 5 6 1  --> 2 5 8
# 7 8 9 1      3 6 9
#              1 1 1
import numpy as np

# a = np.array([[1,2,3],[4,5,6],[7,8,9]])
a = np.arange(1,10).reshape(3,3)
# copy() 拷贝a矩阵
# b = a.copy()
# b = np.zeros(a.shape)
#
# h,w = a.shape
# for i in range(w):
#     for j in range(h):
#         b[i][j] = a[j][i]
# print(b)

# 转置的函数np.transpose
b = np.transpose(a)
print(b)
